$(function () {
  /**
   * ddl语句执行
   */
  $("#ddl-execute").click(function () {
    var ddlSql = $("#ddl-sql").val();
    if(!ddlSql || "" == ddlSql){
      alert("SQL语句不能为空");
      return;
    }
    var msg = "确认执行？\n\n请确认！";
    if (confirm(msg)==false){
          return;
    };
    $("#ddl-sql-result").text("");
    $.ajax({
      type: 'POST',
      url: $.serviceUrl.ddl.execute,
      cache: false,
      async: true,
      contentType: "application/json;charset=UTF-8",
      data:ddlSql,
      success: function (data) {
        if (data) {
          $("#ddl-sql-result").text(data);
        }
      },
      error: function (data) {
        $("#ddl-sql-result").text(data);
      }
    });
  })

});